<?php

namespace App\Http\Controllers;

use App\Model\Backend\Member;
use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Crypt;


class IndexController extends Controller
{
    public function login(Request $request){
        if($request->isMethod('post')) {

            //echo session()->get('member');die;
          $username=$_POST['username'];
          $password=$_POST['password'];
            $user=new Member();
            $Member=$user->checkLogin($username,$password);
            if($Member){
                return  redirect('/data');
            }else{
                return back()->withErrors('账号或密码错误！');
            }
        }else{
            return view('backend.login');
        }
    }
    public function test(Request $request){

        if($request->isMethod('post')) {
            echo "<pre>";
            print_r($_FILES);
        }else{
            return view('test');
        }

    }
}